import {getCash, getCashRecord, getList, getPerson, updatePerson, getBankList} from '@/api/welfareFoundApi'
const welfareFound = {
    namespaced: true,
    state: {
        roleList: []
    },
    getters: {
      
    },
    mutations: { 
    },
    actions: { 
        // 提现
        GetCash ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getCash(params).then(res => {
                    resolve(res)
                }).catch(
                    res => {
                        reject(res)
                    }
                )
            })
        },
        // 获取提现记录
        GetCashRecord ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getCashRecord(params).then(res => {
                    resolve(res)
                }).catch(
                    res => {
                        reject(res)
                    }
                )
            })
        },
        // 获取统计
        GetList ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getList(params).then(res => {
                    resolve(res)
                })
            })
        },
        // 获取个人信息
        GetPerson ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getPerson(params).then(res => {
                    resolve(res)
                })
            })
        },
        // 修改个人信息
        UpdatePerson ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                updatePerson(params).then(res => {
                    resolve(res)
                })
            })
        },
        // 获取银行列表
        GetBankList ({state, commit, dispatch}, params) {
            return new Promise((resolve, reject) => {
                getBankList(params).then(res => {
                    resolve(res)
                })
            })
        }
    }
}
export default welfareFound
